<extend name="_Layout/main"/>

<block name="style">
    <style type="text/css">
        /* 文章列表样式 */
        .article-list .media {
            padding-top: 10px;
            border-top: 1px solid #eee;
        }
        .article-list .list-cover{
            width: 180px;
            height: 100px;
        }
        .article-list .list-title{
            margin-top: 6px;
        }
        .article-list .list-abstract{
            height: 42px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        @media (max-width: 768px) {
            .article-list .list-title{
                font-size: 14px;
                margin: 0px;
            }
            .article-list .list-cover{
                width: 90px;
                height: 66px;
            }
            .article-list .list-info {
                font-size: 10px;
                margin-top: 3px !important;
                margin-bottom: 2px !important;
            }
            .article-list .list-abstract{
                height: 36px;
                font-size: 12px;
            }
        }
    </style>
</block>

<block name="main">
    <div class="container">
        <div class="row">
            <div class="col-xs-12 col-sm-9">
                <!-- 文档列表页面顶部钩子 -->
                <div class="clearfix hook hook-document-list-before">
                    {:hook('DocumentListBefore')}
                </div>

                <!-- 文档列表 -->
                <div class="article-list">
                    <volist name="volist" id="vo">
                        <div class="media">
                            <div class="media-left">
                                <a href="{:U('Document/detail/id/'.$vo['id'])}">
                                    <img class="list-cover lazy" data-original="{$vo.cover|get_cover='default'}">
                                </a>
                            </div>
                            <div class="media-body">
                                <h4 class="list-title text-overflow margin-top-none"><a href="{:U('Document/detail/id/'.$vo['id'])}">{$vo.main_field}</a></h4>
                                <ul class="list-info list-unstyled list-inline text-muted small">
                                    <li><i class="fa fa-calendar"></i> {$vo.ctime|time_format='Y-m-d'}</li>
                                    <li><i class="fa fa-eye"></i> {$vo.view}</li>
                                    <li><i class="fa fa-comments"></i> {$vo.comment}</li>
                                    <li><i class="fa fa-thumbs-o-up"></i> {$vo.good}</li>
                                </ul>
                                <div class="list-abstract text-muted">{$vo.abstract}</div>
                            </div>
                        </div>
                    </volist>
                    <ul class="pagination">{$page}</ul>
                </div>

                <!-- 文档列表页面底部钩子 -->
                <div class="clearfix hook hook-document-list-after">
                    {:hook('DocumentListAfter')}
                </div>
            </div>
            <div class="col-xs-12 col-sm-3 hidden-xs">
                <a href="{:U('Document/add', array('cid' => $__CURRENT_CATEGORY__))}" class="btn btn-primary btn-block">发表</a>
                <div class="blank"></div>

                <!-- 侧边导航 -->
                <div class="list-group">
                    <corethink:category_list name="vo" pid="$__CURRENT_CATEGORY__">
                        <a class="list-group-item <if condition='$vo.id eq $__CURRENT_CATEGORY__'>active</if>" href="{:U('Document/index', array('cid' => $vo['id']))}">
                            {$vo.title}
                        </a>
                    </corethink:category_list>
                </div>

                <!-- 页面侧边栏钩子 -->
                <div class="clearfix hook hook-page-side">
                    {:hook('PageSide')}
                </div>
            </div>
        </div>
    </div>
</block>
